﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SignUp.ascx.cs" Inherits="Zebra.Umbraco.Marcos.SignUp" %>
<form runat="server">
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnCreatedUser="CreateUserWizard1_CreatedUser"
    DuplicateUserNameErrorMessage="用户名已存在，请使用其他用户名" DuplicateEmailErrorMessage="邮件地址已存在，请使用其他邮件地址"
    CompleteSuccessText="注册成功" ContinueButtonText="继续" ActiveStepIndex="0" OnContinueButtonClick="CreateUserWizard1_ContinueButtonClick"
    OnCreatingUser="CreateUserWizard1_CreatingUser" OnLoad="CreateUserWizard1_Load">
    <LayoutTemplate>
        <asp:PlaceHolder ID="wizardStepPlaceholder" runat="server" />
        <asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
    </LayoutTemplate>
    <WizardSteps>
        <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
            <ContentTemplate>
                <h2>
                    注册新帐号</h2>
                <p>
                    <asp:Label ID="Label1" runat="server" AssociatedControlID="Passcode">
                        验证码:</asp:Label>
                    <br />
                    <asp:TextBox Columns="50" ID="Passcode" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Passcode"
                        ErrorMessage="验证码不能为空" ToolTip="验证码不能为空" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    <br />
                    <asp:Label ID="lbQuestion" runat="server" Text="Label"></asp:Label>
                </p>
                <p>
                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">
                        用户名:</asp:Label>
                    <br />
                    <asp:TextBox Columns="50" ID="UserName" runat="server" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                        ErrorMessage="请输入用户名." ToolTip="请输入用户名" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="CustomValidator1" runat="server" ValidateEmptyText="false"
                        ClientValidationFunction="valComments_ClientValidate1" ControlToValidate="UserName"
                        ErrorMessage="用户名长度必须少于50字符并且不能包含空格" ToolTip="用户名长度必须少于50字符并且不能包含空格" ValidationGroup="CreateUserWizard1">*</asp:CustomValidator>
                </p>
                <p>
                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">
                        登录密码:</asp:Label>
                    <br />
                    <asp:TextBox Columns="50" ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="Password"
                        ErrorMessage="密码只能包含字母，数字，及以下英文标点! @ _ , . ? $ -" ToolTip="密码只能包含字母，数字，及以下英文标点! @ _ , . ? $ -"
                        ValidationGroup="CreateUserWizard1" ValidationExpression="^([a-z]|[A-Z]|[0-9]||[!]|[@]|[_]|[,]|[.]|[?]|[$]|[-])*$">*</asp:RegularExpressionValidator>
                    <asp:CustomValidator ID="xxxx" runat="server" ValidateEmptyText="false" ClientValidationFunction="valComments_ClientValidate"
                        ControlToValidate="Password" ErrorMessage="密码长度为6-20位且不包含空格" ToolTip="密码长度为6-20位且不包含空格"
                        ValidationGroup="CreateUserWizard1">*</asp:CustomValidator>
                    <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                        ErrorMessage="密码长度为6-26位且不包含空格" ToolTip="密码长度为6-26位且不包含空格" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">
                        确认密码:</asp:Label>
                    <br />
                    <asp:TextBox Columns="50" ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" Display="Dynamic" runat="server"
                        ControlToValidate="ConfirmPassword" ErrorMessage="请输入确认密码." ToolTip="请输入确认密码"
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="请确认登录密码和确认密码是否一致"
                        ValidationGroup="CreateUserWizard1">*</asp:CompareValidator>
                </p>
                <p>
                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">
                        邮件地址:</asp:Label>
                    <br />
                    <asp:TextBox Columns="50" ID="Email" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="Email"
                        ErrorMessage="邮件地址格式不正确" ToolTip="邮件地址格式不正确" ValidationGroup="CreateUserWizard1"
                        ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                    <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
                        ErrorMessage="请输入邮件地址" ToolTip="请输入邮件地址" ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                </p>
                <p>
                    <asp:Label ID="Label2" runat="server" AssociatedControlID="FullName">
                        姓名:</asp:Label>
                    <br />
                    <asp:TextBox Columns="50" ID="FullName" runat="server" TextMode="SingleLine" MaxLength="50"></asp:TextBox>
                </p>
                <p>
                    <asp:Label ID="Label3" runat="server" AssociatedControlID="CompanyName">
                        公司名:</asp:Label>
                    <br />
                    <asp:TextBox Columns="50" ID="CompanyName" runat="server" TextMode="SingleLine" MaxLength="50"></asp:TextBox>
                </p>
                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
            </ContentTemplate>
            <CustomNavigationTemplate>
                <p class="no-border">
                    <asp:Button CssClass="button" ID="Button1" runat="server" CommandName="MoveNext"
                        Text="注册" />
                </p>
            </CustomNavigationTemplate>
        </asp:CreateUserWizardStep>
        <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
            <ContentTemplate>
                <table>
                    <tr>
                        <td align="center" colspan="2">
                            恭喜
                        </td>
                    </tr>
                    <tr>
                        <td>
                            注册成功
                        </td>
                    </tr>
                    <tr>
                        <td align="right" colspan="2">
                            <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue"
                                Text="继续" ValidationGroup="CreateUserWizard1" />
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:CompleteWizardStep>
    </WizardSteps>
</asp:CreateUserWizard>
<script language="javascript">
    function valComments_ClientValidate(source, args) {
        if (args.Value.trim().length > 6 && args.Value.trim().length < 26) {
            args.IsValid = true;
        }
        else {
            args.IsValid = false;
        }
    }
    function valComments_ClientValidate1(source, args) {
        if (args.Value.trim().length == args.Value.length) {
            if (args.Value.indexOf(" ") > -1) {
                args.IsValid = false;
            }
            else {
                args.IsValid = true;
            }

        }
        else {
            args.IsValid = false;
        }
    }
    
</script>
</form>
